<template>
  <div class="wrapper">
    <swiper ref="mySwiper" :options="swiperOption" v-if="this.swiperList.length>0">
        <swiper-slide v-for="(item,index) in this.swiperList" :key="item.id">
            <img class="swiper-img" :src="item.imgUrl">
            
        </swiper-slide>
        <div class="swiper-pagination" slot="pagination"></div>
    </swiper>
  </div>
</template>

<script>
export default {
    name:'HomeSwiper',
    props:{
      swiperList:Array
    },
    data() {
      return {
        swiperOption: {
          pagination: '.swiper-pagination',
          loop:true,
          autoplay:3000
          ,
        //   autoplay: true,
		      loop: true,
        }
      }
    },
    computed: {
      swiper() {
        return this.$refs.mySwiper.$swiper
      }
    },
    mounted() {
    //   console.log('Current Swiper instance object', this.swiper)
    //   this.swiper.slideTo(3, 2000, true)
    }
}
</script>

<style lang="stylus" scoped>
.wrapper >>> .swiper-pagination-bullet-active
    background #fff
.wrapper
    width 100%
    height 0
    overflow hidden
    padding-bottom 30.48%
    background #ccc
    .swiper-img
        width 100%
    .swiper-pagination
        width 100%
        height 10px
</style>